#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long LL;
const int N = 2e6 + 10;

void solve() {
    int n;
    cin >> n;
    vector<int> arr(n + 10);
    for(int i = 1; i <= n; i ++) cin >> arr[i];
    sort(arr.begin() + 1,arr.begin() + 1 + n);
    int ans = 0;
    for(int i = 1; i <= n; i += 2)
    {
        ans = max(arr[i + 1] - arr[i],ans);
    }
    cout << ans << endl;
}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
}